<!DOCTYPE html>
<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=Utf-8">
  <meta http-equiv="Cache-Control" content="no-cache" />
  <script type="text/javascript" src="./js/qrcode.js"></script>
  <script type="text/javascript" src="./js/constant.js"></script>
  <title>Document</title>
</head>

<body>
  <form name="qrForm">
    <textarea name="msg" rows="4" cols="40">Hello World!</textarea>
    <input type="button" value="提交" onclick="update_qrcode()" />
    <br />
    <canvas id="myCanvas"></canvas>
  </form>
  <script>
    var update_qrcode = function () {
      var form = document.forms['qrForm'];
      var text = form.elements['msg'].value;
      var TypeNumber = 2;
      var ErrorCorrectionLevel = 'M';
      // var Mode = 'Byte';
      // var Multibyte = 'UTF-8';

      create('myCanvas', text, TypeNumber, ErrorCorrectionLevel);
    };
  </script>
</body>

</html>